Add feature flag for quote submissions#274
Merged
Merged
Conversation
- Implemented a new API endpoint to fetch feature flags. - Updated the QuoteDisplay component to disable the submit link based on the feature flag. - Modified the Home component to fetch the feature flag and control the submission of new quotes. - Enhanced the SubmitQuote component to reflect the feature flag status and provide user feedback when submissions are disabled. - Introduced a utility for managing feature flags using Unleash. - Updated unleash configuration for quotes-loadgen.
…logging of control characters
…tion and consistency
There was a problem hiding this comment.
Pull request overview
Adds Unleash-based feature flagging across the quotes example services, gating quote submission (and backend error injection) and wiring NAIS + local dev configuration to support toggles.
Changes:
- Introduces Unleash clients and
/api/featuresendpoints (frontend + backend) to expose flag states. - Gates quote submission in both frontend UI and backend POST handler; adds an error-injection toggle for backend.
- Updates NAIS manifests, local dev (
.mise.toml), docker-compose, and docs to include Unleash configuration.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| quotes-loadgen/.nais/unleash.yaml | Provisions Unleash ApiToken for loadgen service |
| quotes-frontend/src/utils/unleash.ts | Adds Node Unleash client helper + flag constants |
| quotes-frontend/src/app/api/features/route.ts | Adds frontend /api/features route |
| quotes-frontend/src/app/submit-quote/page.tsx | Disables submit UI based on feature flag |
| quotes-frontend/src/app/page.tsx | Disables “Submit a New Quote” entry point based on flag |
| quotes-frontend/src/tests/components/QuoteDisplay.test.tsx | Adds coverage for disabled submit link styling |
| quotes-frontend/package.json / pnpm-lock.yaml | Adds unleash-client dependency |
| quotes-frontend/.nais/unleash.yaml / .nais/app.yaml | Provisions token + mounts secret via envFrom |
| quotes-frontend/.mise.toml | Adds local Unleash env vars |
| quotes-backend/src/main/kotlin/.../FeatureFlags.kt | Adds backend Unleash integration and flag defaults |
| quotes-backend/src/main/kotlin/.../Application.kt | Applies flags to submission + error injection; adds backend /api/features |
| quotes-backend/build.gradle.kts | Adds Unleash Java client dependency |
| quotes-backend/.nais/unleash.yaml / .nais/app.yaml | Provisions token + mounts secret via envFrom |
| quotes-backend/.mise.toml | Adds local Unleash env vars |
| quotes-analytics/Services/QuotesAnalyticsService.cs | Sanitizes IDs before logging/activity tags |
| quotes-analytics/Controllers/AnalyticsController.cs | Sanitizes IDs before logging |
| quotes-analytics/.nais/unleash.yaml | Switches to Unleash ApiToken provisioning |
| docker-compose.yaml | Adds Unleash admin bootstrap + injects Unleash env vars into services |
| README.md / AGENTS.md | Documents Unleash feature flag setup and usage |
| .github/workflows/service-pipeline.yaml / codeql.yml | Updates pinned action SHAs |
| .github/workflows/dependabot-auto-merge.yaml | Changes trigger to pull_request_target |
Files not reviewed (1)
- quotes-frontend/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
quotes-analytics/Services/QuotesAnalyticsService.cs:358
SanitizeForLogis duplicated here and inAnalyticsController. Consider moving it to a shared utility (or a small internal static helper class) to avoid diverging implementations if the sanitization rules change.
}
quotes-analytics/Controllers/AnalyticsController.cs:120
SanitizeForLogis duplicated here and inQuotesAnalyticsService. Consider centralizing it (shared utility/helper) so the sanitization logic stays consistent.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a feature flag to control the submission of quotes, updating the UI components accordingly to reflect the flag's status. This change enhances user feedback and integrates a new API endpoint for fetching feature flags.